<template>
	<view class="content">
		<view class="header">
			<view class="person" style="margin-top: 20px;">
				<image :src="name.avatarUrl" mode=""></image>
			</view>
			<view class="btn_1">
				<button @click="dengL()" v-show="show">微信登录</button>
			</view>
		</view>
		<view class="list_1">
			<view class="list_2 flex" @click="change()">
				<view class="zuo_1 flex">
					<view class="zuo_2">
						<image src="../../static/tongbu.png" mode="" style="width: 20px;height: 20px;"></image>
					</view>
					<view class="you_2" v-for="(item,index) in list">
						<p class="duiwu">{{item.title1}}</p>
					</view>
				</view>
				<view class="you_1">
					>
				</view>
			</view>
		</view>
		<view class="list_1">
			<view class="list_2 flex" @click="change1()">
				<view class="zuo_1 flex">
					<view class="zuo_2">
						<image src="../../static/zil.png" mode="" style="width: 20px;height: 20px;"></image>
					</view>
					<view class="you_2" v-for="(item,index) in list">
						<p class="duiwu">{{item.title2}}</p>
					</view>

				</view>
				<view class="you_1">
					>
				</view>
			</view>
		</view>
		<view class="list_1">
			<view class="list_2 flex" @click="change2()">
				<view class="zuo_1 flex">
					<view class="zuo_2">
						<image src="../../static/rili.png" mode="" style="width: 20px;height: 20px;"></image>
					</view>
					<view class="you_2" v-for="(item,index) in list">
						<p class="duiwu">{{item.title3}}</p>
					</view>

				</view>
				<view class="you_1">
					>
				</view>
			</view>
		</view>
		<view class="list_1">
			<view class="list_2 flex" @click="change3()">
				<view class="zuo_1 flex">
					<view class="zuo_2">
						<image src="../../static/jiangP.png" mode="" style="width: 20px;height: 20px;"></image>
					</view>
					<view class="you_2" v-for="(item,index) in list">
						<p class="duiwu">{{item.title4}}</p>
					</view>

				</view>
				<view class="you_1">
					>
				</view>
			</view>
		</view>
		<view class="list_1">
			<view class="list_2 flex" @click="change4()">
				<view class="zuo_1 flex">
					<view class="zuo_2">
						<image src="../../static/datika.png" mode="" style="width: 20px;height: 20px;"></image>
					</view>
					<view class="you_2" v-for="(item,index) in list">
						<p class="duiwu">{{item.title5}}</p>
					</view>

				</view>
				<view class="you_1">
					>
				</view>
			</view>
		</view>
		<view class="for_each">
			<view class="list_1">
				<view class="list_2 flex" @click="change5()">
					<view class="zuo_1 flex">
						<view class="zuo_2">
							<image src="../../static/jiangB.png" mode="" style="width: 20px;height: 20px;"></image>
						</view>
						<view class="you_2" v-for="(item,index) in list">
							<p class="duiwu">{{item.title6}}</p>
						</view>

					</view>
					<view class="you_1">
						>
					</view>
				</view>
			</view>
			<view class="list_1">
				<view class="list_2 flex" @click="change6()">
					<view class="zuo_1 flex">
						<view class="zuo_2">
							<image src="../../static/bushu.png" mode="" style="width: 20px;height: 20px;"></image>
						</view>
						<view class="you_2" v-for="(item,index) in list">
							<p class="duiwu">{{item.title7}}</p>
						</view>
					</view>
					<view class="you_1">
						>
					</view>
				</view>
			</view>
			<view class="list_1">
				<view class="list_2 flex" @click="change7()">
					<view class="zuo_1 flex">
						<view class="zuo_2">
							<image src="../../static/shouquan.png" mode="" style="width: 20px;height: 20px;"></image>
						</view>
						<view class="you_2" v-for="(item,index) in list">
							<p class="duiwu">{{item.title8}}</p>
						</view>

					</view>
					<view class="you_1">
						>
					</view>
				</view>
			</view>
			<view class="list_3">
				<view class="list_2 flex">
					<view class="zuo_1 flex">
						<view class="zuo_2">
							<image src="../../static/banbenh.png" mode="" style="width: 20px;height: 20px;"></image>
						</view>
						<view class="you_2" v-for="(item,index) in list">
							<p class="duiwu">{{item.title9}}</p>
						</view>

					</view>
					<view class="you_1">
						<span class="math">202202.01</span>>
					</view>
				</view>
			</view>
		</view>
	<!-- 	<view class="activite">
			<view class="box1" v-for="(item,index) in list1" :key="index">
				<view class="main1">
					<!<image :src="item.png" mode="" width="30px" ></image> -->
					<!-- <p @click="listnav(item.id)">{{item.title}}</p> -->
			<!-- 	</view>
			</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1:[],
				name: [],
				show: true,
				list: [{
						title1: '我的队伍',
					},
					{
						title2: '我的资料'
					},
					{
						title3: '今日日期'
					},
					{
						title4: '勋章墙'
					},
					{
						title5: '答题'
					},
					{
						title6: '排行榜'
					},
					{
						title7: '历史步数'
					},
					{
						title8: '授权设置'
					},
					{
						title9: '版本号'
					}

				],
			}
		},
		onLoad() {
			this.person()
		},
		methods: {
			dengL() {
				console.log(123)

				uni.getUserProfile({
					lang: 'zh_CN',
					desc: true,
					desc: '获取你的昵称、头像',
					success: (res) => {
						console.log(res);
						uni.showToast({
							title: "授权成功",
						})
						this.name = res.userInfo
						console.log(this.name)
					}
				})
			},
			change() {
				uni.navigateTo({
					url: "/pages/personal/team"
				})
			},
			change1() {
				uni.navigateTo({
					url: "/pages/personal/ziL"
				})
			},
			change2() {
				uni.navigateTo({
					url: "/pages/personal/today"
				})
			},
			change3() {
				uni.navigateTo({
					url: "/pages/personal/xunZ"
				})
			},
			change4() {
				uni.switchTab({
					url: '/pages/answer/answer'
				})
			},
			change5() {
				uni.switchTab({
					url: '/pages/roll/roll'
				})
			},
			change6() {
				uni.navigateTo({
					url: '/pages/personal/history'
				})
			},
			change7() {
				uni.navigateTo({
					url: '/pages/personal/shouQ'
				})
			},
			listnav(id){
				if(id==2){
					uni.navigateTo({
							url: "/pages/personal/team"
						})
				}else if(id==3){
					uni.navigateTo({
							url: "/pages/personal/ziL"
						})
				}else if(id==4){
					uni.navigateTo({
							url: "/pages/personal/today"
						})
				}else if(id==5){
					uni.navigateTo({
							url: "/pages/personal/xunZ"
						})
				}else if(id==6){
					uni.switchTab({
							url: "/pages/answer/answer"
						})
				}else if(id==7){
					uni.switchTab({
							url: "/pages/roll/roll"
						})
				}else if(id==8){
					uni.navigateTo({
							url: "/pages/personal/history"
						})
				}
			},
			person: function() {
				var that=this
				uni.request({
					url: "http://180.76.120.179:8081/xiaochengxu/index/core",
					data: "",
					success(res) {
						console.log(res.data.data)
						var datas = res.data.data
						that.list1=datas
					}
				})
			},
			
		}
	}
</script>

<style>
	.flex {
		display: flex;
		justify-content: space-between;
	}

	.header {
		background-color: red;
		margin-top: -20px;
		height: 500rpx;
	}
.main1 image{width: 40rpx;height: 40rpx;}
	.person {
		width: 240rpx;
		height: 240rpx;
		border-radius: 240rpx;
		background-color: aliceblue;
		margin: 0 auto;
	}

	.person image {
		width: 100%;
		height: 100%;
		border-radius: 240rpx;
	}

	.btn_1 button {
		width: 50%;
		margin-top: 20px;
		background-color: aquamarine;
		color: darkseagreen;
		margin-bottom: 50px;
	}

	.list_1 {
		width: 95%;
		padding: 20rpx;
		margin: 0 auto;
		/* margin-top: 20px; */
		border-bottom: 2px solid #ccc;
		/* padding-bottom: 10px; */
	}

	.list_3 {
		width: 95%;
		padding: 20rpx;
		margin: 0 auto;
	}

	.list {
		width: 95%;
		padding: 20rpx;
		margin: 0 auto;
	}

	.duiwu {
		font-size: 30rpx;
		text-indent: 1rem;
	}

	.math {
		margin-right: 10px;
		color: #666;
		font-size: 20rpx;
	}
</style>
